<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); 
class Phonebook extends MY_Controller
{
	
	public function __construct()
	{
		parent::__construct();
		$this->load->model(array('M_student'));
		$this->load->library(array('form_validation','notifier'));
		$this->load->helper(array('form'));
	}
	
	public function index()
	{
		
	}
	
	public function student_phonebook()
	{
		if($_POST)
		{
			$parameter = $this->input->post('search_param');
			$result = $this->M_student->get_student_details_thru_phonebook($parameter);
			if(empty($result))
			{
				$this->view_data['system_message'] = $this->notifier->build_system_message('notice', 'No matches found...');
			}else
			{
				$this->view_data['search_results'] = $result;
				$this->view_data['search_param'] = $parameter;
			}
			
		}
	}
}
?>